package com.ethink.warehouse.api.component.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
public class WarehouseEtonbaoConfirmInStockRequest {
    private String apiMethodName;

    private EntryOrder entryOrder;

    private List<OrderLine> orderLines;

    private String responseClass;

    private String version;

    @Data
    public static class EntryOrder {
        private String entryOrderCode;

        private String entryOrderId;

        private String entryOrderType;

        private String operateTime;

        private String outBizCode;

        private String ownerCode;

        private String purchaseOrderCode;

        private String remark;

        private String status;

        private String warehouseCode;
    }

    @Data
    public static class OrderLine {
        private Integer actualQty;

        private List<OrderLineBatch> batchs;

        private String inventoryType;

        private String itemCode;

        private String itemId;

        private String outBizCode;

        private String ownerCode;
    }

    @Data
    public static class OrderLineBatch {
        private Integer actualQty;

        private String batchCode;

        private String inventoryType;

        private String produceCode;

        @DateTimeFormat(pattern = "yyyy-MM-dd")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        private Date productDate;

        @DateTimeFormat(pattern = "yyyy-MM-dd")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        private Date expireDate;
    }
}
